/**
 * Created by uncle-yang on 2017/2/8.
 */
// import log from "pc/utils/log.js";
import * as types from "./mutations-type";
// import jsonp from "jsonp";
// import JQuery from "jquery";
import Axios from "axios";
import log from "utils/log.js";



/**
 * 获取图片类型
 */
export const getTestVal = ({ commit, dispatch}, {loadFirst = true}) => {
	//模拟数据,背景图片列表


	// var param = {
	// 	m: "Web",
	// 	a: "getStock"
	// }

	// var dataStr = querystring.stringify(param);

	// log.info("111111111");
	// log.info(dataStr);

	// jsonp("http://123.59.214.203/fastadmin/public/index/houseworker/getHouseworker?phone=13064442414", {
		
	// },

	// function(err, data) {

	// 	log.info("======================");
	// 	log.info(err);
	// 	log.info(data);


	// 	if (!err) {
	// 		log.info("data --------------------------");
	// 		// log.info(data);

	// 		commit(types.SET_TEST_VAL, data);

	// 	}else{
	// 		log.info("eee ajax none");

	// 		log.info(err);

	// 	}
	// })


	Axios({
		method: "get",
		url: "http://123.59.214.203/fastadmin/public/index/houseworker/getHouseworker?phone=13064442414",
		responseType: "json"
	})
	.then(function(response) {
		log.info(response);
		if (response.status == 200) {
			commit(types.SET_TEST_VAL, response.data);
		}

	})
	.catch(function (error) {
		log.info(error);
	});
	


	// commit(types.SET_TEST_VAL, simulateClass);


};

